package com.ai.bitcoin.jpa.service.impl;

import com.ai.bitcoin.jpa.dao.ExchangeUserRelDao;
import com.ai.bitcoin.jpa.entity.ExchangeUserRel;
import com.ai.bitcoin.jpa.service.ExchangeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: ${description}
 * @author: gulj
 * @create: 2018-08-02 21:53
 **/
@Service
public class ExchangeUserServiceImpl implements ExchangeUserService {

    @Autowired
    private ExchangeUserRelDao exchangeUserRelDao;

    @Override
    public boolean checkUserConfigExchange(String openId) {
        List<ExchangeUserRel> userRelList = findByOpenId(openId);
        return null != userRelList && !userRelList.isEmpty();
    }

    @Override
    public List<ExchangeUserRel> findByOpenId(String openId) {
        return exchangeUserRelDao.findByOpenId(openId);
    }
}
